#include<stdio.h>

int a[100], b[100];
int n = 0;
int t;

void bubble_sort(int *a, int n) {
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= n - i - 2; j++) {
            if (a[j] > a[j + 1]) {
                int t = a[j];
                a[j] = a[j + 1];
                a[j + 1] = t;
            }
        }
    }
}

bool is_sorted(int a[], int n) {
    for (int i = 0; i < n; i++)b[i] = a[i];
    bubble_sort(a, n);

    for (int i = 0; i < n; i++) {
        if (a[i] != b[i])return false;
    }
    return true;
}

int main() {
    freopen("A.in", "r", stdin);
    while (~scanf("%d", &t)) {
        a[n] = t;
        n++;
    }

    if (is_sorted(a, n)) {
        printf("YES");
    } else {
        printf("NO");
    }
    return 0;
}